import request from "../util/request";

export const addAdvRequest =  (myForm) =>{
  return request.post('/addAdv',myForm)
}

//查询所有的广告
export const advListRequest = (pageNo,everyNum) => {
  return request.get(`/advList/${pageNo}/${everyNum}`)
}

//删除广告
export const deleteAdvListRequest = (_id) =>{
  return request.delete('/deleteAdv',
    {
      params:{
        _id
      }
    })
}

//添加更新广告模块的内容的请求
export const getUpdateDataRequest = (_id) => {
  return request.get("/getUpdateData", {
    params: {
      _id
    }
  })
}

//更新广告逻辑
export const updateAdvRequest = (formData, _id) => {
  return request.put("/updateAdv", formData, {
    params: {
      _id
    }
  })
}